const menuModel = require('../../model/menu/menuModel')
class menuService{
  //查询菜单
  async getMenu(req,res){
    const{results:data} = await menuModel.menu()
    if(data.length != 0 ){
      return res.json({
        data,
        meta: {
          msg: '获取菜单信息成功',
          status: 200
        } 
      })
    }else{
      return res.json({
        meta: {
            msg: '获取菜单信息失败',
            status: 404
        }
      })
    }
  }
}

module.exports = new menuService()